<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    html,
    body {
        background-color: gray;
    }

    .all {
        margin-top: 100px;
        width: 100%;
        background-color: white;
        height: 565px;
    }

    .top {
        display: flex;
        justify-content: space-between;
    }

    .top span:nth-child(1) {
        margin-left: 10px;
    }

    .top span:nth-child(2) {
        margin-right: 10px;
    }

    .jiaqian {
        display: flex;
    }

    img {
        width: 80px;
        height: 80px;
    }

    .xinxi {
        display: flex;
        margin-left: 10px;
    }

    .money {
        margin-left: 10px;
    }

    .jiaqian {
        margin-top: 30px;
    }

    .jiaqian section:nth-child(2) {
        margin-left: 100px;
    }

    button {
        width: 20px;
        height: 20px;
    }

    .summary {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background-color: #555;
        color: white;
        left: 0;
        position: fixed;
        bottom: 0;
        width: 100%;
        padding: 10px;
        box-sizing: border-box;
    }

    .summary span:nth-child(2) {
        background-color: lightgreen;
        color: white;
        padding: 5px 15px;
        border-radius: 5px;
    }
</style>

<body>
    <div class="all">
        <section class="top">
            <span>已选商品</span>
            <span @click="clean">清空</span>
        </section>
        <div v-for="(item,index) in list" :key="index" class="xinxi">
            <section>
                <img :src="item.pic" alt="">
            </section>
            <section class="money">
                <p class="name">{{item.name}}</p>
                <div class="jiaqian">
                    <section>￥{{item.price}}</section>
                    <section>
                        <button @click="sub(item)">-</button>
                        <span>{{item.count}}</span>
                        <button @click="add(item)">+</button>
                    </section>
                </div>
            </section>
        </div>
        <div class="summary">
            <span>总数:{{totalCount}} 总价:{{totalPrice}} </span>
            <span>去结算</span>
        </div>
    </div>
</body>
<script src="./vue-2.5.21.js"></script>
<script src="./购物车.js"></script>

</html>